<?php
$Set_Title		= $config_nc->Add.' '.$config_nc->Support;
$Set_Submit		= 'add';
$Id				= $func->html_get('u2');
$ErrorQ 		= $func->GetSession('ErrorQ');
$name 			= $func->GetSession('name');
$type 			= $func->GetSession('type');
$account 		= $func->GetSession('account');
$status 		= $func->GetSession('status');
$sort 			= $func->GetSession('sort');
if($sort==''){
	$sort = $support_class->GetMaxSort();	
	$sort++;
}
if($status==''){
	$status = 1;	
}
$func->DelSession('ErrorQ');
$func->DelSession('name');
$func->DelSession('account');
$func->DelSession('status');
$func->DelSession('sort');

if($Id!='' && $support_class->isInt($Id)){
	$Row_Result   	= $support_class->GetById($Id);	
	if(is_array($Row_Result)){
		$name 			= $Row_Result[0]['name'];
		$type 			= $Row_Result[0]['type'];
		$account 		= $Row_Result[0]['account'];
		$sort 			= $Row_Result[0]['sort'];
		$status 		= $Row_Result[0]['status'];		
	}else{
		$notFound = 0;
	}
	$Set_Submit 	= 'edit' ;
	$Set_Title		= $config_nc->Edit.' '.$config_nc->Support;
}

?> 
<div class="dataTables db">
	<div class="dataTables_bar db">
    	<h5 class="title dib"><?php echo $Set_Title;?></h5>        
    </div><!--end dataTables_bar-->
    <div class="themuser db">
    	<?php 
		if(isset($notFound) && $notFound==0){
			echo '<div class="notFound">'.$config_nc->NotFound.'</div>';	
		}else{
		?>             
    	<form class="form-centent" action="<?php echo $WEB_DOMAIN.'/'.$WEB_ADMIN.'/index.php?u1=_support&u2='.$Set_Submit;?>" method="post">
        	<ul class="nd db">
            	<li>
                    <label class="span2 fl">&nbsp;</label>
                    <span class="errorq"><?php if(isset($ErrorQ)){echo $ErrorQ;}?>&nbsp;</span>
                </li>      
                <li>
                    <label class="span2 fl"><?php echo $support_nc->Type;?></label>
                    <select name="type"> 
                     	<option value="1" <?php if(isset($type) && $type==1){echo 'selected="selected"';}?>>Yahoo</option>
                        <option value="2" <?php if(isset($type) && $type==2){echo 'selected="selected"';}?>>Skype</option>
                        <option value="3" <?php if(isset($type) && $type==3){echo 'selected="selected"';}?>><?php echo $support_nc->Type3; ?></option>
                    </select> 
                </li>
                <li>
                    <label class="span2 fl"><?php echo $support_nc->Name;?></label>
                    <input name="name" type="text" class="span3" value="<?php if(isset($name)){ echo $name;}?>" >
                </li>
                <li>
                    <label class="span2 fl"><?php echo $support_nc->Account;?></label>
                    <input name="account" type="text" class="span3" value="<?php if(isset($account)){ echo $account;}?>" >
                </li>                
                <li>
                    <label class="span2 fl"><?php echo $config_nc->status;?></label>
                    <select name="status">                    	
                        <option value="0" <?php if(isset($status) && $status==0){echo 'selected="selected"';}?>><?php echo $config_nc->status_2;?></option>
                        <option value="1" <?php if(isset($status) && $status==1){echo 'selected="selected"';}?>><?php echo $config_nc->status_1;?></option>
                    </select>
                </li>     
            </ul>
            <div class="form-actions db">      
            	<button type="submit"><?php echo $config_nc->Accept;?></button>          
                <input type="hidden" name="id" value="<?php if($Id!=''){ echo $Id;}?>" />
                <a class="dib" href="<?php echo $WEB_DOMAIN.'/'.$WEB_ADMIN.'/index.php?u1=list-support'; ?>"><?php echo $config_nc->Cancel;?></a>
            </div><!--end form-actions-->
        </form>
        <?php }?>
        
    </div>
</div><!--end dataTables-->